<template>
	<div>
		<header class="aui-header">
			<a class="aui-pull-left aui-btn">
				<!--<span class="aui-iconfont aui-icon-left"></span>-->
				<img src="../assets/rightbut.png">
			</a>
			<div class="aui-title">重置密码</div>
		</header>
		<div class="pwdcon">
			<div class="samesty">
				<span class="samename">密码 </span>
				<input type="password" class="sameinput" placeholder="请输入密码"  ref="newpwd">
			</div>
			<div class="samesty">
				<span class="samename">确认密码</span>
				<input type="password" class="sameinput" placeholder="请输入确认码" ref="surepwd">
			</div>
			<span class="toolfont">请输入8-16位的数字</span>
			<div class="stepbut" @click="surebut">确定</div>
		</div>

	</div>
</template>

<script>
	import { BaseUrl } from '../Baseurl/common.js';
	export default {
		data() {
			return {
				listurl: [],
				newjson: [],
				hovered: false,
				count: '',
				timer: null,
				show: true,

			}
		},
		created() {

		},
		methods: {
			surebut:function(){
				var href = window.location.href;
				var tokens = href.split('?');
				var newpwd = this.$refs.newpwd.value;
				var surepwd = this.$refs.surepwd.value;
				if(newpwd != surepwd){
					alert('输入密码和确认密码不一致！！');
					return;
				}
				var url = BaseUrl+'users/chgpwd?appId=gzh&newpwd='+newpwd+'&confirmpwd='+surepwd+'&'+tokens[1];
				this.$http.get(url).then(res => {
					console.log(res);
					this.newjson = res;
					if(res.data.code == "10000"){
						alert('修改成功！');
					}
					//this.$router.push({ path: '/resetpwd' })
				})
				
			}
		}
	}
</script>

<style scoped="scoped">
	.pwdcon {
		margin-top: 1.2rem;
		padding: 0.25rem;
		background-color: #FFFFFF;
	}
	
	.samesty {
		width: 100%;
		height: 0.6rem;
		line-height: 0.6rem;
		border-bottom: solid 0.01rem #CCCCCC;
		margin-top: 0.2rem;
	}
	
	.samename {
		display: inline-block;
		color: #989898;
		width: 22%;
	}
	
	.sameinput {
		display: inline-block;
		height: 0.5rem;
		line-height: 0.5rem;
		width: 75%;
		outline: none;
		margin-left: 0.1rem;
	}
	
	.samesty:nth-child(1) {
		margin-top: 0rem;
	}
	
	.verfcode {
		width: 40%;
	}
	
	.indentcode {
		display: inline-block;
		float: right;
		border: solid 1px #ff2040;
		height: 0.5rem;
		padding: 0 0.1rem;
		color: #ff2040;
		line-height: 0.5rem;
		font-size: 0.24rem;
	}
	
	.stepbut {
		width: 100%;
		height: 0.8rem;
		background-color: #FF2040;
		text-align: center;
		line-height: 0.8rem;
		color: #fff;
		margin-top: 0.5rem;
		margin-bottom: 0.5rem;
		border-radius: 0.4rem;
	}
	.toolfont{
		display: block;
		margin-top: 0.1rem;
		font-size: 0.2rem;
		color: #989898;
	}
</style>